const chooseFile = require("../controller/checkIndex");

module.exports = {
  checkout(req, res) {
    let suffix = req.url.split(".")[1]; //['page/index','html']
    if (suffix == "html" || suffix == "css" || suffix == "js") {
      chooseFile.HtmlJsCss(req, res);
    } else if (
      suffix == "jfif" ||
      suffix == "png" ||
      suffix == "jpg" ||
      suffix == "jpeg"
    ) {
      chooseFile.Image(req, res);
    } else if (suffix == "woff") {
      //https://www.jianshu.com/p/d4010366dd2b
      chooseFile.fonts(req, res);
    }
  },
};
